package com.ruoyi.health.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.health.mapper.HealthReportMapper;
import com.ruoyi.health.domain.HealthReport;
import com.ruoyi.health.service.IHealthReportService;

/**
 * 报告信息Service业务层处理
 * 
 * @author rockvan
 * @date 2023-04-10
 */
@Service
public class HealthReportServiceImpl implements IHealthReportService 
{
    @Autowired
    private HealthReportMapper healthReportMapper;

    /**
     * 查询报告信息
     * 
     * @param id 报告信息主键
     * @return 报告信息
     */
    @Override
    public HealthReport selectHealthReportById(Long id)
    {
        return healthReportMapper.selectHealthReportById(id);
    }

    /**
     * 查询报告信息列表
     * 
     * @param healthReport 报告信息
     * @return 报告信息
     */
    @Override
    public List<HealthReport> selectHealthReportList(HealthReport healthReport)
    {
        return healthReportMapper.selectHealthReportList(healthReport);
    }

    /**
     * 新增报告信息
     * 
     * @param healthReport 报告信息
     * @return 结果
     */
    @Override
    public int insertHealthReport(HealthReport healthReport)
    {
        healthReport.setCreateTime(DateUtils.getNowDate());
        return healthReportMapper.insertHealthReport(healthReport);
    }

    /**
     * 修改报告信息
     * 
     * @param healthReport 报告信息
     * @return 结果
     */
    @Override
    public int updateHealthReport(HealthReport healthReport)
    {
        healthReport.setUpdateTime(DateUtils.getNowDate());
        return healthReportMapper.updateHealthReport(healthReport);
    }

    /**
     * 批量删除报告信息
     * 
     * @param ids 需要删除的报告信息主键
     * @return 结果
     */
    @Override
    public int deleteHealthReportByIds(Long[] ids)
    {
        return healthReportMapper.deleteHealthReportByIds(ids);
    }

    /**
     * 删除报告信息信息
     * 
     * @param id 报告信息主键
     * @return 结果
     */
    @Override
    public int deleteHealthReportById(Long id)
    {
        return healthReportMapper.deleteHealthReportById(id);
    }
}
